<template>
  <el-form ref="refFrom" label-position="top" class="padding">
    <el-row>
      <el-col :span="6">
        <el-form-item label="订单号">
          {{currentItem.orderId}}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="订单金额(元)">{{currentItem.choosePrice/100}} </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="业务类型">{{$common.marchType(currentItem.orderType,dict.order_type)}}</el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="酒店名称">
          {{currentItem.vendorName}}
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="6">
        <el-form-item label="供氧时长(秒)">
          {{currentItem.chooseTime}}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="支付时间">
          {{currentItem.payTime}}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="支付状态">
          {{$common.marchType(currentItem.status,dict.order_status)}}
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <el-form-item label="优惠劵(现金/满减)">
          <span style="background:#F6F7FB;padding:20px"> 使用现金优惠券抵扣 {{currentItem.couponDiscount/100}} 元 </span>
          <!-- 使用 {{$common.marchType(currentItem.coupon.couponType,dict.coupon_type)}} 优惠券抵扣 {{currentItem.coupon.discount/100}} 元 -->
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="活动积分">
          <span style="background:#F6F7FB;padding:20px"> 使用积分抵扣 {{currentItem.pointsDiscount/100}} 元 </span>
          <!-- <span style="background:#F6F7FB;padding:20px"> 使用 {{currentItem.points.points}} 积分抵扣 {{currentItem.points.discount/100}} 元 </span> -->
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <b></b>
      </el-col>
    </el-row>
  </el-form>
</template>

<script lang="ts">
export default {
  mounted() {
    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
    this.proxy = proxy;

    this.dict = toRefs<any>(this.proxy?.useDict('room_position', 'order_status', 'order_type', 'coupon_type'));

    this.init();
  },
  props: {
    data: {}
  },
  data() {
    return {
      dict: {},
      proxy: null,
      currentItem: {}
    };
  },
  created() {},
  methods: {
    init(data) {
      if (data == null) data = this.data;
      this.currentItem = JSON.parse(JSON.stringify(data));
    }
  }
};
</script>

<style scoped>
.padding {
  padding: 0px;
}
</style>
